package one.stand.fallback;

import com.jmp.base.dto.SmsCaptchaCheckRequest;
import com.jmp.base.dto.SmsCaptchaCheckResponse;
import com.jmp.base.dto.SmsCaptchaRequest;
import com.jmp.base.dto.SmsSendRequest;
import com.jmp.feign.SmsFeign;
import one.stand.model.ResultModel;
import org.springframework.stereotype.Component;

/**
 * @author cjr
 */
@Component
public class SmsFallback implements SmsFeign {
    @Override
    public ResultModel sendBatchSms(SmsSendRequest request) {
        return ResultModel.faultTolerant();
    }

    @Override
    public ResultModel captchaSend(SmsCaptchaRequest request) {
        return ResultModel.faultTolerant();
    }

    @Override
    public ResultModel<SmsCaptchaCheckResponse> captchaCheck(SmsCaptchaCheckRequest request) {
        SmsCaptchaCheckResponse response = SmsCaptchaCheckResponse.builder()
                .success(false)
                .build();
        return ResultModel.success(response);
    }
}
